import fire

from config import settings
import socketserver
from server.tcp_server import TCPRequestHandler


def start_tcp_server():
    HOST, PORT = "0.0.0.0", settings.TCP_PORT
    with socketserver.ThreadingTCPServer((HOST, PORT), TCPRequestHandler) as server:

        server.serve_forever()


if __name__ == "__main__":
    fire.Fire({
        'tcp-server': start_tcp_server,
    })
